package com.itheima.HomeWork_day09;

import java.util.TreeSet;

/*
自然排序：
 */
public class NaturalSort02 {

    public static void main(String[] args) {

        //创建集合
        TreeSet<People> ts = new TreeSet<>();

        //创建对象
        People p1=new People("xiaoming",12);
        People p2=new People("dadong",10);
        People p3=new People("huahua",11);
        People p4=new People("xiaohua",10);

        //添加到集合中去
        ts.add(p1);
        ts.add(p2);
        ts.add(p3);
        ts.add(p4);

        //打印集合结果
        System.out.println(ts);

    }



}
